package controllers

import "github.com/astaxie/beego"

//HelperController	the helper controller
type HelperController struct {
	beego.Controller
}

//ServeAPI supper json and jsonp
func (ac *HelperController) ServeAPI() {
	if cb := ac.GetString(`callback`); cb != "" {
		ac.Data[`jsonp`] = ac.Data[`json`]
		delete(ac.Data, `json`)
		ac.ServeJSONP()
	}
	ac.ServeJSON()
}
